import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import Antd from "ant-design-vue";
import "ant-design-vue/dist/reset.css";
import "bootstrap/dist/css/bootstrap.css";
import "bootstrap/dist/js/bootstrap";

import "xe-utils";
import VXETable from "vxe-table";
import "vxe-table/lib/style.css";

import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import store from "./store/store";

import "highlight.js/styles/atom-one-dark.css";
import "highlight.js/lib/common";
import hljsVuePlugin from "@highlightjs/vue-plugin";

// markdown 展示插件
import VMdPreview from "@kangc/v-md-editor/lib/preview";
import VMdEditor from "@kangc/v-md-editor/lib/codemirror-editor";
import githubTheme from "@kangc/v-md-editor/lib/theme/github.js";
// highlightjs
import hljs from "highlight.js";
// codemirror 编辑器的相关资源
import Codemirror from "codemirror";
VMdEditor.Codemirror = Codemirror;
// 使用数据公式渲染
import createKatexPlugin from "@kangc/v-md-editor/lib/plugins/katex/cdn";

VMdEditor.use(githubTheme, {
  Hljs: hljs,
});
VMdEditor.use(createKatexPlugin());

VMdPreview.use(githubTheme, {
  Hljs: hljs,
});
VMdPreview.use(createKatexPlugin());

const app = createApp(App);

app.use(store); //使用 Vuex管理全局变量
app.use(router);
app.use(VXETable);
app.use(ElementPlus);
app.use(VMdEditor).use(VMdPreview);
app.use(Antd);
app.use(hljsVuePlugin); // 展示代码
app.mount("#app");
